package com.daify.threadlearn.chapter01.order08;

/**
 * @author daify
 * @date 2019-06-13
 */
public class DeadLock {

    private final Object ONE = new Object();
    private final Object TWO = new Object();

    public void getOne() {
        synchronized (ONE) {
            synchronized (TWO) {
                // doSome
            }
        }
    }

    public void getTwo() {
        synchronized (TWO) {
            synchronized (ONE) {
                // doSome
            }
        }
    }
}
